package com.wang.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.GenericGenerator;

/**
 * @author: 王雪洋
 * @Date: 2017年8月5日 上午12:09:56
 * @Description:第一个用户实体类
 */
@Entity
@Table(name="t_user")
public class User {
	@Id
	@Column(name="id")
	//声明主键生成器
	@GenericGenerator(name="tidg",strategy="increment")
	//主键生成器的使用
	@GeneratedValue(generator="tidg")
	private Integer id;
	@Column(name="username")
	private String username;
	@Column(name="password")
	private String password;
	@Column(name="bir")
	@Temporal(TemporalType.DATE)
	private Date bir;
	@Column(name="salary")
	private double salary;
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Date getBir() {
		return bir;
	}

	public void setBir(Date bir) {
		this.bir = bir;
	}

	public double getSalary() {
		return salary;
	}

	public void setSalary(double salary) {
		this.salary = salary;
	}
	
	public User() {
		super();
	}

	public User(Integer id, String username, String password, Date bir, double salary) {
		super();
		this.id = id;
		this.username = username;
		this.password = password;
		this.bir = bir;
		this.salary = salary;
	}
	@Override
	public String toString() {
		return "User [id=" + id + ", username=" + username + ", password=" + password + ", bir=" + bir + ", salary="
				+ salary + "]";
	}
}
